<!-- <template>
  <div>
    <el-button @click="tc" v-if="token">退出登录</el-button>
    <el-row class="tac">
      <el-col :span="12">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
          <el-submenu :index="1 + 1" v-for="(i, x) in menulist" :key="x">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>{{ i.name }}</span>
            </template>
            <el-menu-item-group>
              <el-menu-item
                :index="j.url"
                v-for="(j, x) in i['son']"
                :key="x"
                @click="t(j.url)"
                >{{ j.name }}</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // JSON.parse:转位json格式
      menulist: JSON.parse(localStorage.getItem("menulist")),
      token:localStorage.getItem("token")
    };
  },
  methods: {
    t(url) {
      this.$router.push(url);
    },
    tc(){
      this.axios.get("/Exit").then(res =>{
        window.localStorage.clear()
        alert(res.data.msg)
      })
    }
  },
};
</script>

<style>
</style> -->
